package com.ysqcould.Community.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ysqcould.Community.domain.VolArea;
import com.ysqcould.common.core.domain.entity.SysMenu;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Treeselect树结构实体类
 *
 * @author ruoyi
 */
public class VolAreaTree implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private Long id;

    /** 节点名称 */
    private String label;

    private String enable;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<VolAreaTree> children;

    public VolAreaTree()
    {

    }

    public VolAreaTree(VolArea volArea)
    {
        this.id = volArea.getId();
        this.label = volArea.getName();
        this.enable=volArea.getEnable();
        this.children = volArea.getChildren().stream().map(VolAreaTree::new).collect(Collectors.toList());
    }

    public VolAreaTree(SysMenu menu)
    {
        this.id = menu.getMenuId();
        this.label = menu.getMenuName();
        this.children = menu.getChildren().stream().map(VolAreaTree::new).collect(Collectors.toList());
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable;
    }
    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public List<VolAreaTree> getChildren()
    {
        return children;
    }

    public void setChildren(List<VolAreaTree> children)
    {
        this.children = children;
    }
}
